Skip to content

fix(ui): polish marketplace announcement card and dedupe V1 card#28066

Merged
siddhant1 merged 4 commits into
mainfrom
fix/marketplace-announcement-card-styling
May 14, 2026
Merged

fix(ui): polish marketplace announcement card and dedupe V1 card#28066
siddhant1 merged 4 commits into
mainfrom
fix/marketplace-announcement-card-styling

Conversation

@siddhant1
Copy link
Copy Markdown
Member

Summary

  • V2 marketplace card: decouple text / background / border colors in AnnouncementCardV1Content so V2 can use distinct design tokens. Switches V2 to the blue-dark utility palette (50 / 500 / 600 for bg / border / text), fixes the runtime CSS variable name (--tw-color-utility-blue-dark-*), and tightens the compact variant to 27px tall, fixed 247px wide, 4px corners, with the border on the outer title section.
  • V1 home page card: stop duplicating the JSX that was inlined during the Task-redesign migration (51ecf4502f) and delegate back to AnnouncementCardV1Content. Generalize the shared component so the rich header (user + icon + entity link) renders whenever userName / entityName are provided — field-operation-text stays gated on fieldOperation. V1 keeps its gradient via backgroundColor; V2 passes a solid color.

Test plan

  • Open the Data Marketplace landing page and confirm the announcement widget renders with: solid #EFF4FF background, #2970FF left border, #155EEF text, 27px height, 4px corners.
  • Open the My Data home page and confirm the V1 announcement card still renders with its white-to-primary gradient, 3px left border, and "no announcement" placeholder when description is empty.
  • Run AnnouncementCardV1.test.tsx — may need updates if it asserts on inlined DOM that's now delegated.
  • Run yarn ui-checkstyle:changed.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings May 13, 2026 06:06
@siddhant1 siddhant1 requested a review from a team as a code owner May 13, 2026 06:06
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

V2 marketplace announcement card:
- Decouple text / background / border into three props on AnnouncementCardV1Content (backgroundColor, borderColor, currentBackgroundColor) so they can use distinct design tokens.
- Switch V2 to the blue-dark utility palette: --tw-color-utility-blue-dark-{50,500,600} for bg / border / text. Use the prefixed Tailwind variable name so it resolves at runtime.
- Compact variant now renders at 27px tall with rounded-4px corners, flex-none so a fixed width sticks, and px-10 / py-6 padding on the title-section only.
- Border moved from the inner .announcement-header to the outer .announcement-title-section so it follows the rounded corners.

V1 home page announcement card:
- Stop duplicating the JSX inlined during the Task-redesign migration (51ecf45) and delegate back to AnnouncementCardV1Content. The original Thread-based shape required fieldOperation/columnName which AnnouncementEntity no longer has - the migration inlined a stripped-down version instead of updating the shared component.
- Generalize AnnouncementCardV1Content so the rich header (user + icon + entity link) renders whenever userName or entityName is provided. field-operation-text stays gated on fieldOperation; title paragraph below renders whenever the rich header was used and title is set.
- V1 keeps its gradient look by passing the linear-gradient string through backgroundColor; V2 passes a solid color.
@siddhant1 siddhant1 force-pushed the fix/marketplace-announcement-card-styling branch from 32e072a to 19498a7 Compare May 13, 2026 06:08
@github-actions
Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

Comment on lines +62 to +64
const gradientBackground = currentBackgroundColor
? `linear-gradient(270deg, #ffffff -12.07%, ${currentBackgroundColor} 500.72%)`
: undefined;
Copy link
Copy Markdown

@gitar-bot gitar-bot Bot May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Edge Case: V1 card gets solid background when currentBackgroundColor is falsy

When currentBackgroundColor is not provided (or falsy) to AnnouncementCardV1, gradientBackground will be undefined. In AnnouncementCardV1Content, this causes bgColor to fall back to color (which is PRIMARY_COLOR), resulting in a solid primary-color background + 3px border being applied.

The old inlined V1 code returned an empty style object {} when currentBackgroundColor was falsy — meaning no inline background/border at all. This is a behavioral regression for that edge case.

In practice, the parent AnnouncementsWidgetV1 always passes a bgColor derived from theme config, so this may not surface in production, but it's a latent bug if the component is reused or tested without that prop.

Always provide a gradient background (matching the old AnnouncementCardV1Content default behavior) so the fallback is consistent regardless of whether currentBackgroundColor is set.:

const gradientBackground = currentBackgroundColor
  ? `linear-gradient(270deg, #ffffff -12.07%, ${currentBackgroundColor} 500.72%)`
  : `linear-gradient(270deg, #ffffff -12.07%, var(--ant-primary-color) 500.72%)`;

Was this helpful? React with 👍 / 👎

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors and polishes the marketplace announcement card UI by reusing the existing V1 announcement card content component, while adding support for separately configuring background and border colors so V2 can use distinct design tokens.

Changes:

  • Added backgroundColor and borderColor overrides to AnnouncementCardV1Content to decouple styling tokens.
  • Refactored V1 home-page announcement card to reuse AnnouncementCardV1Content instead of duplicating JSX.
  • Updated V2 marketplace announcement item to use the shared content component with “blue-dark” palette tokens and compact variant styling.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx Adds color override props and updates compact/default variant styling and header/title rendering conditions.
openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1.component.tsx Removes duplicated card markup and delegates rendering to AnnouncementCardV1Content.
openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/announcement-card-v1-content.less Removes header border-left to support moving the accent border to the outer title section via inline styles.
openmetadata-ui/src/main/resources/ui/src/components/DataMarketplace/AnnouncementsWidgetV2/AnnouncementItemV2.component.tsx Switches V2 to the shared content component and attempts to apply blue-dark tokenized styling.
Comments suppressed due to low confidence (1)

openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:60

  • PR description mentions the compact variant should be 27px tall (and fixed width 247px), but the compact config still sets tw:h-[30px] and does not set a fixed width. If the visual spec is still 27px/247px, please adjust the compact variant styles accordingly (or update the PR description to match the implemented sizing).
  compact: {
    header: 'tw:h-[30px] tw:flex-none tw:text-xs tw:rounded-[4px]',
    titleSection: 'tw:px-[10px] tw:py-[6px] tw:pl-1',
    entityName: 'tw:!text-[11px] tw:!font-normal',
    iconSize: 'tw:size-[9px]',
    title: 'tw:text-xs tw:font-medium tw:!mb-0',

Comment on lines +56 to +57
header: 'tw:h-[30px] tw:flex-none tw:text-xs tw:rounded-[4px]',
titleSection: 'tw:px-[10px] tw:py-[6px] tw:pl-1',
Comment on lines 74 to 79
<AnnouncementCardV1Content
backgroundColor="var(--tw-color-utility-blue-dark-50)"
borderColor="var(--tw-color-utility-blue-dark-500)"
columnName={columnName}
currentBackgroundColor="var(--color-utility-blue-100)"
currentBackgroundColor="var(--tw-color-utility-blue-dark-600)"
description={description}
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 62%
62.56% (64767/103526) 43.27% (35278/81522) 46.07% (10378/22526)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 13, 2026

🟡 Playwright Results — all passed (15 flaky)

✅ 4055 passed · ❌ 0 failed · 🟡 15 flaky · ⏭️ 103 skipped

Shard Passed Failed Flaky Skipped
✅ Shard 1 299 0 0 4
🟡 Shard 2 744 0 6 25
🟡 Shard 3 781 0 3 7
🟡 Shard 4 788 0 2 18
🟡 Shard 5 708 0 1 41
🟡 Shard 6 735 0 3 8
🟡 15 flaky test(s) (passed on retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/ColumnLevelTests.spec.ts › Column Value Mean To Be Between (shard 2, 1 retry)
  • Features/KnowledgeCenterList.spec.ts › Knowledge Center List - Test infinite scroll/pagination (shard 2, 2 retries)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/KnowledgeCenterTextEditor.spec.ts › Rich Text Editor - Text Formatting (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Features/Table.spec.ts › Tags term should be consistent for search (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/CustomProperties.spec.ts › Set dateTime-cp custom property on column and verify in UI (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 4, 1 retry)
  • Pages/ExplorePageRightPanel_KnowledgeCenter.spec.ts › Should remove user owner for knowledgeCenter (shard 5, 2 retries)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/ODCSImportExport.spec.ts › Multi-object ODCS contract - object selector shows all schema objects (shard 6, 1 retry)
  • Pages/UserDetails.spec.ts › Create team with domain and verify visibility of inherited domain in user profile after team removal (shard 6, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Siddhant and others added 2 commits May 14, 2026 14:11
Update border and background tokens on AnnouncementsWidgetV2 to use
utility-blue-dark-100 (#D1E0FF) / utility-blue-dark-50 (#EFF4FF) per
the Untitled UI spec, align the loading skeleton with the loaded card,
and drop the zero-padded count format (01 -> 1).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Switch the AnnouncementsWidgetV2 border from utility-blue-dark-100 to
gray-blue-100 (#EAECF5) to match the updated design spec.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 14, 2026 08:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:231

  • Behavior change for the V1 card: previously the title <Typography.Paragraph className="announcement-title"> was rendered unconditionally for every announcement. The shared component now renders the title paragraph only when (userName || entityName) && title. Although the fallback header branch shows title as the header text when userName/entityName are missing, an announcement that has both a userName/entityName and a title will keep working, but a description-only announcement (no entity, no user) will lose the dedicated title block and instead show the title squeezed into the small header strip with the timestamp. Please confirm this is the intended behavior for the V1 home-page card or guard the title separately for V1.
      {(userName || entityName) && title && (
        <Typography.Paragraph
          className={classNames('announcement-title', variantConfig.title)}
          ellipsis={{ tooltip: true, rows: 2 }}>
          {title}
          {columnName && (
            <Typography.Text>
              {`${t('label.column-name')}: ${columnName}`}
            </Typography.Text>
          )}
        </Typography.Paragraph>
      )}

@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented May 14, 2026

Code Review ⚠️ Changes requested 0 resolved / 1 findings

Decouples announcement card styling tokens and delegates V1 card rendering to a shared component. The V1 card loses its background gradient when currentBackgroundColor is falsy, which needs to be addressed.

⚠️ Edge Case: V1 card gets solid background when currentBackgroundColor is falsy

📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1.component.tsx:62-64 📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1.component.tsx:71-74 📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:85-87 📄 openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:94-99

When currentBackgroundColor is not provided (or falsy) to AnnouncementCardV1, gradientBackground will be undefined. In AnnouncementCardV1Content, this causes bgColor to fall back to color (which is PRIMARY_COLOR), resulting in a solid primary-color background + 3px border being applied.

The old inlined V1 code returned an empty style object {} when currentBackgroundColor was falsy — meaning no inline background/border at all. This is a behavioral regression for that edge case.

In practice, the parent AnnouncementsWidgetV1 always passes a bgColor derived from theme config, so this may not surface in production, but it's a latent bug if the component is reused or tested without that prop.

Always provide a gradient background (matching the old AnnouncementCardV1Content default behavior) so the fallback is consistent regardless of whether currentBackgroundColor is set.
const gradientBackground = currentBackgroundColor
  ? `linear-gradient(270deg, #ffffff -12.07%, ${currentBackgroundColor} 500.72%)`
  : `linear-gradient(270deg, #ffffff -12.07%, var(--ant-primary-color) 500.72%)`;
🤖 Prompt for agents
Code Review: Decouples announcement card styling tokens and delegates V1 card rendering to a shared component. The V1 card loses its background gradient when `currentBackgroundColor` is falsy, which needs to be addressed.

1. ⚠️ Edge Case: V1 card gets solid background when currentBackgroundColor is falsy
   Files: openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1.component.tsx:62-64, openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1.component.tsx:71-74, openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:85-87, openmetadata-ui/src/main/resources/ui/src/components/MyData/Widgets/AnnouncementsWidgetV1/AnnouncementCardV1/AnnouncementCardV1Content.component.tsx:94-99

   When `currentBackgroundColor` is not provided (or falsy) to `AnnouncementCardV1`, `gradientBackground` will be `undefined`. In `AnnouncementCardV1Content`, this causes `bgColor` to fall back to `color` (which is `PRIMARY_COLOR`), resulting in a solid primary-color background + 3px border being applied.
   
   The old inlined V1 code returned an empty style object `{}` when `currentBackgroundColor` was falsy — meaning no inline background/border at all. This is a behavioral regression for that edge case.
   
   In practice, the parent `AnnouncementsWidgetV1` always passes a `bgColor` derived from theme config, so this may not surface in production, but it's a latent bug if the component is reused or tested without that prop.

   Fix (Always provide a gradient background (matching the old AnnouncementCardV1Content default behavior) so the fallback is consistent regardless of whether currentBackgroundColor is set.):
   const gradientBackground = currentBackgroundColor
     ? `linear-gradient(270deg, #ffffff -12.07%, ${currentBackgroundColor} 500.72%)`
     : `linear-gradient(270deg, #ffffff -12.07%, var(--ant-primary-color) 500.72%)`;

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

@siddhant1 siddhant1 enabled auto-merge (squash) May 14, 2026 10:49
@siddhant1 siddhant1 merged commit 8dcf2a9 into main May 14, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants